package com.ht.pms.core.dao.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;

import com.ht.pms.core.dao.SalaryRpDao;

@Service
public class SalaryRpDaoImpl implements SalaryRpDao {

	@Autowired
	private JdbcTemplate jdbcTemplate;

	@Override
	public List<Map<String, Object>> workInfoByMounth(Map<String, Object> paramMap) {
		String sql = "SELECT t.column86 AS '年份', t.column87 AS '月份', SUM(t.column14) AS '实出勤天数',SUM(t.column88) AS '加班1.5(H)',SUM(t.column89) AS '加班2(H)',SUM(t.column90) AS '加班3(H)' FROM t_dict_record_c t where t.audit_state=1 AND t.in_state=1 GROUP BY t.column86,t.column87";
		return jdbcTemplate.queryForList(sql);
	}

	@Override
	public List<Map<String, Object>> salaryInfoByMounth(Map<String, Object> paramMap) {
		String sql = "SELECT  t.column86 AS '年份', t.column87 AS '月份', SUM(t.column48) AS '实发工资',SUM(t.column46) AS '应交个税'  FROM t_dict_record_c t where t.audit_state=1 AND t.in_state=1 GROUP BY t.column86,t.column87";
		return jdbcTemplate.queryForList(sql);
	}

}
